const http = uni.$u.http

//微信登录
export const doLogin = (data) => http.post('/cs-member/sso/weixin/login', data)
// 获取帖子列表
export const getPostsList = (data) => http.get('/cs-posts/discuss-posts/list', data)
// 获取帖子搜索列表
export const getSearchList = (type, data) => http.get(`/cs-search/posts/search/${type}`, data)
// 获取帖子详情
export const getPostsDeatil = (discussPostId) => http.get(`/cs-posts/discuss-posts/detail/${discussPostId}`)
// 发表评论
export const addComment = (params) => http.post('/cs-posts/comment/add', params)
// 获取分类列表
export const getClassifyList = () => http.get('/cs-posts/deal-classify/list')

// 获取上传凭证
export const getUploadToken = () => http.get('/cs-posts/discuss-posts/uploadToken')
// 发表帖子
export const publishDealPost = (params) => http.post('/cs-posts/discuss-posts/add', params)

// 风景帖子点赞
export const likePost = (params) => http.post('/cs-posts/like', params)
//记录浏览的商品
export const recordPostWatch = (params) => http.post('/cs-posts/record/watch', params)
//记录想要的商品
export const recordPostWant = (params) => http.post('/cs-posts/record/want', params)

// 获取我的帖子
export const getUserPosts = (data) => http.get('/cs-posts/discuss-posts/userPosts', data)
// 更新帖子状态
export const postUpdate = (data) => http.post('/cs-posts/discuss-posts/deal/update', data)
// 删除帖子
export const deletePost = (data) => http.post('/cs-posts/discuss-posts/delete', data)

// 更新用户信息
export const userInfoUpdate = (data) => http.post('/cs-member/user/info/modify', data)
// 获取用户认证信息
export const getUserApprove = () => http.get('/cs-member/user/info/get')
// 重新加载token更新用户权限
export const loadToken = () => http.post('/cs-member/user/info/loadToken')

// 获取用户维修上报列表
export const getMaintainList = (data) => http.get('/cs-repairs/maintain/list', data)
// 获取维修上报详情
export const getDetails = (id) => http.get(`/cs-repairs/maintain/detail/${id}`)
// 修改上报信息
export const modifyMaintain = (data) => http.post('/cs-repairs/maintain/modify', data)
// 提交上报信息
export const commitMaintain = (data) => http.post('/cs-repairs/maintain/confirm', data)

// 首页轮播图
export const getCategory = () => http.get('/cs-posts/front/category')
// 通知公告
export const getSysNotice = () => http.get('/cs-posts/front/notice')
// 提交意见反馈
export const commitFeedback = (data) => http.post('/cs-posts/front/feedback', data)

//获取我购买到的订单
export const getOrderByBuy = (data) => http.get('/cs-posts/order/getBuy', data)
//获取我卖出的订单数据
export const getOrderBySale = (data) => http.get('/cs-posts/order/sale', data)
//提交订单
export const commitOrder = (data) => http.post('/cs-posts/order/commit', data)
//更新订单状态
export const modifyOrder = (data) => http.post('/cs-posts/order/modify', data)